home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr13 / aurora2c.zip / VIEWMEM.AML < prev    next >
Text File  |  1995-04-07  |  1KB  |  63 lines

  1.  
  2. // ───────────────────────────────────────────────────────────────────
  3. // The Aurora Editor v2.0
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // View DOS memory
  7. //
  8. // This macro reads a user-specified portion of DOS memory into a
  9. // text buffer for viewing/editing (demonstrates the use of the AML
  10. // 'peek' function).
  11. //
  12. // Note: the address specified is "absolute", not segmented. For example,
  13. // 095A:0943 would be specified as: ((095Ah x 16) + 943h) = 9EE3h (40675)
  14. // ───────────────────────────────────────────────────────────────────
  15.  
  16.   include bootpath "define.aml"
  17.  
  18.   // make line length 64 bytes
  19.   define
  20.     set linelength 64
  21.   end
  22.  
  23.   var total_bytes
  24.  
  25.  
  26.   // prompt the user for address and length
  27.   address = ask "Enter memory address"
  28.   length = ask "Number of bytes to read"
  29.  
  30.   if not length then
  31.     return
  32.   end
  33.  
  34.   if address == ' '  then
  35.     address = 0
  36.   end
  37.  
  38.   // create new binary buffer
  39.   buffer = createbbuf
  40.  
  41.   while total_bytes < length do
  42.  
  43.     // get mem contents and insert into buffer
  44.     insline (peek address linelength)
  45.  
  46.     // move to the last line in the buffer
  47.     down 1
  48.  
  49.     // setup to read next memory location
  50.     address = address + linelength
  51.  
  52.     // total up bytes read
  53.     total_bytes = total_bytes + linelength
  54.   end
  55.  
  56.   // delete blank first line
  57.   delline 1 1
  58.  
  59.   // edit the new buffer in a window
  60.   setbufname (qualify "TEMP.TXT" (getbufname))
  61.   openbuf buffer
  62.  
  63.